package Service.impl;

import Service.ICategoryService;
import dao.ICategoryDao;
import dao.impl.CategoryDaoImpl;
import pojo.Category;

import java.util.List;

public class CategoryServiceImpl implements ICategoryService {
    private ICategoryDao categoryDao=new CategoryDaoImpl();
    @Override
    public void addCategory(Category category) {
        categoryDao.addCategory(category);
    }

    @Override
    public void updateCategory(Category category) {
        categoryDao.updateCategory(category);
    }

    @Override
    public void deleteCategory(int id) {
        categoryDao.deleteCategory(id);
    }

    @Override
    public List<Category> findAll() {
        return categoryDao.findAll();
    }

    @Override
    public Category findById(int id) {
        return categoryDao.findById(id);
    }
}
